package com.bjgzy.rating.mvp.model;

import com.bjgzy.rating.mvp.contract.SignUpContract;
import com.eduhzy.ttw.commonsdk.entity.CommonData;
import com.eduhzy.ttw.commonsdk.entity.SaveWorksData;
import com.eduhzy.ttw.commonsdk.entity.SignUp1ParentData;
import com.eduhzy.ttw.commonsdk.entity.SignUp2Data;
import com.eduhzy.ttw.commonsdk.http.CommonApi;
import com.jess.arms.di.scope.ActivityScope;
import com.jess.arms.integration.IRepositoryManager;
import com.jess.arms.mvp.BaseModel;

import java.util.List;
import java.util.Map;

import javax.inject.Inject;

import io.reactivex.Observable;

/**
 * @author xubo
 * @date 2018-8-9 11:43:59
 */
@ActivityScope
public class SignUp1Model extends BaseModel implements SignUpContract.Model {


    @Inject
    public SignUp1Model(IRepositoryManager repositoryManager) {
        super(repositoryManager);
    }

    @Override
    public Observable<CommonData<SignUp2Data>> saveWorks(SaveWorksData saveData) {
        return mRepositoryManager.obtainRetrofitService(CommonApi.class).saveWorks(saveData);
    }

    @Override
    public Observable<CommonData<List<SignUp1ParentData>>> getClassify(Map<String, Object> map) {
        return mRepositoryManager.obtainRetrofitService(CommonApi.class).getClassify(map);
    }
}